package leihua;

import jakarta.servlet.http.HttpSessionEvent;
import jakarta.servlet.http.HttpSessionListener;

/**
 * @Author leiHua
 * @Date 2022/9/23 15:49
 */
public class SeesionListener implements HttpSessionListener {
    private static int count=0; //在线人数
    @Override
    public void sessionCreated(HttpSessionEvent se) {
        count++;
    }

    @Override
    public void sessionDestroyed(HttpSessionEvent se) {
        if (count>0)
        count--;
    }
}
